<%@ taglib uri="/WEB-INF/myfaces_html.tld" 	prefix="h" %>
<%@ taglib uri="/WEB-INF/myfaces_core.tld" 	prefix="f" %>
<%@ taglib uri="/WEB-INF/tomahawk.tld"     	prefix="t" %>
<%@ page import="java.util.ArrayList" %>

<f:view>
    <jsp:include page="/intestazione.jsp">
        <jsp:param name="titolo" value="Gestione Causali"/>
    </jsp:include>
    <jsp:include page="/menu.jsp"/>
    <script language="javascript" src="./script/popup_full_center.js"></script>
    <script language="javascript" src="./script/confirmCM.js"></script>    
    <script language="javascript" src="./script/ripristinoSessione.js"></script>        
    <br />
    <table class="find" style="border: 2pt solid white; margin-bottom: -10px">
        <hr />
        <tr>  
            <td class="intestazionePagina" align="center">
            <strong>GESTIONE CAUSALI</strong></td>                        
        </tr>        
    </table>
    
    <t:saveState value="#{beanCausale}"/>
    <h:form binding="#{dettaglioCausale.form}" id="formLookup">         
        <table class="dettaglio">
            <tbody>           
            <tr>                   
                <td class="etichettaDettaglio"><strong><t:outputLabel for="codice" value="Codice"/></strong></td>
                <td><t:inputText id="codice" value="#{beanCausale.codice}" size="10" maxlength="5" styleClass="dettaglio_InputText" immediate="true" disabled="false"/></td>
            </tr>              

            <tr>                   
                <td class="etichettaDettaglio"><strong><t:outputLabel for="descrizione" value="Descrizione (*)"/></strong></td>
                <td><t:inputText id="descrizione" value="#{beanCausale.descrizione}" styleClass="dettaglio_InputText" onchange="this.value=this.value.toUpperCase()" size="50" maxlength="50" required="true"/>
                <br/><h:message style="color: red" for="descrizione" showDetail="true" showSummary="false" /></td>
            </tr>            
        </table>
        <br/>
        <t:inputHidden value="#{beanCausale.id}"/>
        <table bgcolor="#FFFFFF" width="750px">
            <tr>     
                <td>
                    <h:commandLink styleClass="commandLink_Style" dir="RTL" action="benvenuto" immediate="true">
                        <t:graphicImage url="/image/go-home.png" border="0"/>
                    </h:commandLink>              
                </td>   
                <td>
                    <t:commandLink action="#{dettaglioCausale.primo}"  rendered="#{beanCausale.id ne null}">
                        <t:graphicImage url="image/primo.png" border="0" title="Vai al primo elemento"/>
                        <f:param name="bean" value="beanCausale"/>                        
                        <f:param name="id" value="#{beanCausale.id}"/>                 
                    </t:commandLink>
                </td>
                <td>
                    <t:commandLink action="#{dettaglioCausale.precedente}" rendered="#{beanCausale.id ne null}">
                        <t:graphicImage url="image/indietro.png" border="0" title="Indietro"/>
                        <f:param name="bean" value="beanCausale"/>                        
                        <f:param name="id" value="#{beanCausale.id}"/>                 
                    </t:commandLink>
                </td>
                <td>
                    <t:commandLink action="#{dettaglioCausale.successivo}" rendered="#{beanCausale.id ne null}">
                        <t:graphicImage url="image/avanti.png" border="0" title="Avanti"/>
                        <f:param name="bean" value="beanCausale"/>                        
                        <f:param name="id" value="#{beanCausale.id}"/>                 
                    </t:commandLink>
                </td>
                <td>
                    <t:commandLink action="#{dettaglioCausale.ultimo}" rendered="#{beanCausale.id ne null}">
                        <t:graphicImage url="image/ultimo.png" border="0" title="Vai all'ultimo elemento"/>
                        <f:param name="bean" value="beanCausale"/>                        
                        <f:param name="id" value="#{beanCausale.id}"/>                 
                    </t:commandLink>
                </td>
                <td>
                    <h:commandLink dir="RTL" onmousedown="return confirmDelete(this);" title="cancella" action="#{dettaglioCausale.cancella}" rendered="#{beanCausale.id ne null}">
                        <t:graphicImage url="image/stop.png" border="0" title="Cancella"/>
                        <f:param name="bean" value="beanCausale" />
                    </h:commandLink>                
                </td>                               
                <td>
                    <h:commandLink dir="RTL" onmousedown="return confirmUpdate(this);" title="modifica" action="#{dettaglioCausale.modifica}" rendered="#{beanCausale.id ne null}">
                        <t:graphicImage url="image/salva.png" border="0" title="Salva modifiche"/>
                        <f:param name="bean" value="beanCausale" />
                    </h:commandLink>                
                </td>    
                <td>
                    <h:commandLink dir="RTL" onmousedown="return confirmSave(this);" title="salva inserimento" action="#{dettaglioCausale.inserisci}" rendered="#{beanCausale.id eq null}">
                        <t:graphicImage url="image/salva.png" border="0" title="Salva inserimento"/>
                        <f:param name="bean" value="beanCausale" />
                    </h:commandLink>                
                </td> 
                <%--
                <td>
                <h:commandLink dir="RTL" title="Annulla operazione" action="#{dettaglioCausale.annulla}" rendered="#{beanCausale.id eq null}" immediate="true">
                <t:graphicImage url="image/delete.png" border="0"/>
                <f:param name="bean" value="beanCausale" />
                </h:commandLink>                     
                </td>
                --%>
                <td>
                    <h:commandLink dir="RTL" title="inserisce nuovo elemento" action="#{dettaglioCausale.inserisciDettaglio}" rendered="#{beanCausale.id ne null}">
                        <t:graphicImage url="image/nuovo.png" border="0" title="Inserisci NUOVO"/>
                        <f:param name="bean" value="beanCausale" />
                    </h:commandLink>
                </td>
                
                <td>
                    <h:commandLink  title="LISTA" id="lista" action="#{dettaglioCausale.lista}" rendered="#{beanCausale.id ne null}">
                        <t:graphicImage url="image/lista.png" border="0" title="Carica lista" style="width:32px; height:32px"/>
                        <f:param name="bean" value="Causale" />
                    </h:commandLink>
                </td>     
           
                <td>                
                    <t:commandLink id="cerca1" onclick="loadurl('pages_ricerca/ricercaCausali.jsf');" immediate="true" rendered="#{beanCausale.id ne null}">
                        <t:graphicImage url="image/find.png" border="0" title="Cerca Elemento" style="width:32px; height:32px"/>
                    </t:commandLink>
                </td> 
                
                <td>                
                    <t:commandLink id="aiuto" onclick="loadurl('info/legendaBottoniDettaglio.jsf');" immediate="true">
                        <t:graphicImage url="image/help.png" border="0" title="Aiuto"/>
                    </t:commandLink>
                </td> 
            </tr>
        </table>
    </h:form> 
    
    <h:form id="erroriDataBase" rendered="false">
        <f:verbatim><table><td align="left" class="messaggiErrore" height="2px"></f:verbatim>           
        <h:messages style="color: red" showDetail="true" showSummary="false"/>
        <f:verbatim></td></table></f:verbatim>
    </h:form>     
    
    <jsp:include page="/piePagina.jsp"/>      
</f:view>